<?php
session_start();
$email=str_ireplace("%40", "@", $_REQUEST["email"]);
$_SESSION['email']=$email;
$con=mysql_connect("localhost","root","");
if(!$con)
{
	die('Could not connect to server');
}
mysql_select_db("se_group2",$con);
$result = mysql_query('SELECT *
		FROM  `user`
		WHERE `user`.`email_id` ="'.$email.'"');
$row = mysql_fetch_array($result);
$uid = $row['UID'];
$_SESSION['UID']=$uid;
$role=$row['Role'];
switch($role)
{
	case 3:
			$uri = 'http://';
			$uri .= $_SERVER['HTTP_HOST'];
			header('Location: '.$uri.'/student/subjectmain.php');
			break;
}
exit;
?>